﻿<Panels:ClosableControl 
    x:Class="MediaBrowser.Gui.Views.UserCtrlDataPictures"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:ViewModel="clr-namespace:MediaBrowser.Gui.ViewModels"
    xmlns:Panels="clr-namespace:MediaBrowser.CustomControls.Panels;assembly=MediaBrowser.CustomControls"
    xmlns:julmar="http://www.julmar.com/wpfhelpers"
    mc:Ignorable="d" d:DesignWidth="347" d:DesignHeight="246">

    <UserControl.Resources>
        <ViewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="imageCross">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imageCross" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                        <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.5"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="imageCross">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imageCross" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.5"/>
                        <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="imageForward">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imageForward" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                        <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.5"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="imageForward">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imageForward" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.5"/>
                        <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </UserControl.Triggers>

    <Grid DataContext="{Binding Pictures, Mode=OneWay, Source={StaticResource Locator}}">
        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" BorderThickness="3,3,3,3" 
                CornerRadius="4,4,4,4" Background="{DynamicResource BckWindow}">
            <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF4E5E9F" Offset="0"/>
                    <GradientStop Color="#FF25677A" Offset="1"/>
                </LinearGradientBrush>
            </Border.BorderBrush>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="10"/>
                    <RowDefinition Height="15"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="15"/>
                </Grid.RowDefinitions>
                <Image x:Name="imageCross" Grid.Row="0" HorizontalAlignment="Right" Source="/MediaBrowser.Gui;Component/Images/cross2.png" PreviewMouseDown="Close_Event" RenderTransformOrigin="0.5,0.5" >
                    <Image.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Image.RenderTransform>
                </Image>
                <Label Content="Notes : " Margin="10,0,0,0" Grid.Row="1"/>
                <TextBox x:Name="txDescription" Grid.Row="2"
                         Text="{Binding CurrentMedia.Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         TextWrapping="Wrap"
                         AcceptsReturn="True" FontFamily="Freestyle Script" FontSize="32" Margin="10,5">
                    <julmar:EventCommander.Mappings>
                        <julmar:CommandEvent Command="{Binding SaveDescriptionCommand}" Event="LostKeyboardFocus" CommandParameter="{Binding ElementName=txDescription, Path=Text}" />
                    </julmar:EventCommander.Mappings>
                </TextBox>
                <Image x:Name="imageForward" Grid.Row="3" HorizontalAlignment="Right" Source="/MediaBrowser.Gui;Component/Images/Forward.png" ToolTip="Voir l'image" RenderTransformOrigin="0.5,0.5" >
                    <Image.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Image.RenderTransform>
                </Image>
            </Grid>
        </Border>
    </Grid>
</Panels:ClosableControl>
